import request from './request.js'

//根据本地ip地址获取位置信息
export const getIpData = () => {
    const key = '	27bd1627cfb9a097f41cd3fe96e8a7e9'; 
    return request({
      method: 'GET',
      url: `/ip?key=${key}`, 
    })
}

export const getAdCodeData = (city) => {
    const key = '	27bd1627cfb9a097f41cd3fe96e8a7e9'; 
    return request({
      method: 'GET',
      url: `/geocode/geo?key=${key}&address=${city}`, 
    })
}

export const getWeatherData = (adcode) => {
    const key = '	27bd1627cfb9a097f41cd3fe96e8a7e9'; 
    return request({
      method: 'GET',
      url: `/weather/weatherInfo?key=${key}&city=${adcode}&extensions=all`,
    })
}
